#include <stdio.h>
#include <memory.h>
#include <math.h>
#include <algorithm>
using namespace std;


#define MAX_ROW 11
#define MAX_STATUS 2048
long long DP0[MAX_STATUS];
long long DP1[MAX_STATUS];
int g_Width, g_Height;

bool TestFirstLine(int nStatus)  //test the first line
{
	int i = 0; 
	while( i < g_Width)
	{
		if(nStatus & (0x1 << i))
		{
			if( i == g_Width -1 || (nStatus & (0x1 << (i+1))) == 0)
			{
				return false;
			}
			i += 2;
		}
		else
		{
			i++;
		}
	}
	return true;
}

bool CompatablityTest(int nStatusA, int nStatusB) // test if status (i, nStatusA) and (i-1, nStatusB) is compatable.
{
	int i = 0;

	while( i < g_Width)
	{
		if( (nStatusA & (0x1 << i))  == 0)
		{
			if((nStatusB & (0x1 << i)) == 0)
			{
				return false;
			}
			i++;
		}
		else
		{
			if((nStatusB & (0x1 << i)) == 0 )
			{
				i++;
			}
			else if( (i == g_Width - 1) || ! ( (nStatusA & (0x1 << (i+1))) && (nStatusB & (0x1 << (i + 1)))) )
			{
				return false;
			}
			else
			{
				i += 2;
			}

		}
	}
	return true;
}
int main()
{
	int i,j;
	int k;
	while(scanf("%d%d", &g_Height, &g_Width) != EOF )
	{
		if(g_Width == 0 && g_Height == 0)
		{
			break;
		}

		if(g_Width > g_Height)
		{
			swap(g_Width, g_Height);
		}


		int nAllStatus = 2 << (g_Width-1);
		memset(DP0, 0, sizeof(DP0));
		memset(DP1, 0, sizeof(DP1));
		for( j = 0; j < nAllStatus; j++)
		{
			if(TestFirstLine(j))
			{
				DP0[j] = 1;
			}
		}

		for( i = 1; i < g_Height; i++)
		{    
			for( j = 0; j < nAllStatus; j++)// iterate all status for line i
			{
				for( k = 0; k < nAllStatus; k++) // iterate all status for line i-1
				{
					if(CompatablityTest(j, k))
					{
						DP1[j] += DP0[k];
					}
				}
			}
            std::copy(DP1, DP1+MAX_STATUS, DP0);
            memset(DP1, 0, sizeof(DP1));
		}
		printf("%lld\n", DP0[nAllStatus - 1]);
	}
	return 0;
}
